package com.atguigu.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class HelloController {

    @RequestMapping("/")
    public String portal(){
       return "index";
    }

    @RequestMapping(
            value = {"/success","/success2","/succe?ss","/succe*ss","/**/success"},
            method = {RequestMethod.POST,RequestMethod.GET}
//            ,params = {"username","!password","age=20","sex!=male"}
)
    public String success(){
        return "success";
    }

    @RequestMapping("/rest/{username}/{id}")
    public String test(@PathVariable("username") String username,@PathVariable("id") Integer id){
        System.out.println("username:"+username+"id:"+id);
        return "success";
    }

    
}
